{echo:JS::import('dialog?skin=brief');}
{echo:JS::import('dialogtools');}
{echo:JS::import('form');}
<form action="" method="post">
<div class="tools_bar clearfix">
    <a class="icon-delicious" href="{url:/customer/fan_info_list}"> 全部记录</a>
    <span class="fr"><a href='javascript:;' id="condition" class="icon-search" style="" > 筛选条件</a><input id="condition_input" type="hidden" name="condition" value="{$condition}"></span>
</div>
<table class="default" >
    <tr>
        <th>用户</th>
        <th>订单编号</th>
        <th>订单金额</th>
        <th>需要返还金额</th>
        <th>已经返还金额</th>
        <th>差额</th>
        <th>创建时间</th>
        <th>最后一次返现时间</th>
        
        <th>是否结束</th>   
    </tr>
    {query:name=fan as bl fields=bl.*,us.name join=left join user as us on bl.user_id eq us.id where= $where order= bl.id desc id=$obj page=1 desc }
        <tr class="{if:$key%2==1}odd{/if}">
        <td>{$item['name']}
        	{if:$item['is_seller']==1}
        	&nbsp;<b style="color:red;">商</b>
        	{else:}
        	&nbsp;<b style="color:green;">消</b>
        	{/if}
        </td>
        <td>{$item['order_no']}</td>
        <td>{$item['je']}</td>
        <td>{$item['need_je']}</td>
        <td>{$item['already_je']}</td>
        <td>{echo:sprintf("%.2f",$item['need_je']-$item['already_je'])}</td>
        <td>{$item['create_time']}</td>
        <td>{$item['fan_time']}</td>
        
        <td>
        	{if:$item['is_over']==0}
        		否
        	{elseif:$item['is_over']==1}
        		是
        	{/if}
        </td>
        </tr>
    {/query}
</table>
</form>
<div class="page_nav">
{echo:$obj->pageBar()}
</div>
<script type="text/javascript">
    var form =  new Form();
    $("#condition").on("click",function(){
        $("body").Condition({input:"#condition_input",okVal:'高级搜索',callback:function(data){tools_submit({action:'{url:/customer/fan_info_list}',method:'get'});},data:{'fan_time':{name:'最后一次返现时间'},'name':{name:'用户名'},'xjq':{name:'现金券'},'je':{name:'订单金额'},'need_je':{name:'需要返现金额'},'already_je':{name:'已返现金额'},'need_je-already_je':{name:'差额'},'order_no':{name:'订单编号'}
        }});
    });
</script>
